Optimal. Leaf size=221 \[ -\frac {4 \sqrt {2} a^2 (A-B) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac {1}{2};-\frac {3}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{f \sqrt {\sin (e+f x)+1}}-\frac {8 \sqrt {2} a^2 B \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac {1}{2};-\frac {5}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{f \sqrt {\sin (e+f x)+1}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.34, antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {2987, 2784, 139, 138} \[ -\frac {4 \sqrt {2} a^2 (A-B) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac {1}{2};-\frac {3}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{f \sqrt {\sin (e+f x)+1}}-\frac {8 \sqrt {2} a^2 B \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac {1}{2};-\frac {5}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{f \sqrt {\sin (e+f x)+1}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 138
Rule 139
Rule 2784
Rule 2987
Rubi steps
\begin {align*} \int (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) (c+d \sin (e+f x))^n \, dx &=(A-B) \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx+\frac {B \int (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx}{a}\\ &=\frac {\left (a^2 (A-B) \cos (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(1+x)^{3/2} (c+d x)^n}{\sqrt {1-x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}+\frac {\left (a^2 B \cos (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(1+x)^{5/2} (c+d x)^n}{\sqrt {1-x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}\\ &=\frac {\left (a^2 (A-B) \cos (e+f x) (c+d \sin (e+f x))^n \left (-\frac {c+d \sin (e+f x)}{-c-d}\right )^{-n}\right ) \operatorname {Subst}\left (\int \frac {(1+x)^{3/2} \left (-\frac {c}{-c-d}-\frac {d x}{-c-d}\right )^n}{\sqrt {1-x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}+\frac {\left (a^2 B \cos (e+f x) (c+d \sin (e+f x))^n \left (-\frac {c+d \sin (e+f x)}{-c-d}\right )^{-n}\right ) \operatorname {Subst}\left (\int \frac {(1+x)^{5/2} \left (-\frac {c}{-c-d}-\frac {d x}{-c-d}\right )^n}{\sqrt {1-x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}\\ &=-\frac {8 \sqrt {2} a^2 B F_1\left (\frac {1}{2};-\frac {5}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{f \sqrt {1+\sin (e+f x)}}-\frac {4 \sqrt {2} a^2 (A-B) F_1\left (\frac {1}{2};-\frac {3}{2},-n;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{f \sqrt {1+\sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F] time = 26.08, size = 0, normalized size = 0.00 \[ \int (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) (c+d \sin (e+f x))^n \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.53, size = 0, normalized size = 0.00 \[ {\rm integral}\left (-{\left ({\left (A + 2 \, B\right )} a^{2} \cos \left (f x + e\right )^{2} - 2 \, {\left (A + B\right )} a^{2} + {\left (B a^{2} \cos \left (f x + e\right )^{2} - 2 \, {\left (A + B\right )} a^{2}\right )} \sin \left (f x + e\right )\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 3.87, size = 0, normalized size = 0.00 \[ \int \left (a +a \sin \left (f x +e \right )\right )^{2} \left (A +B \sin \left (f x +e \right )\right ) \left (c +d \sin \left (f x +e \right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \left (A+B\,\sin \left (e+f\,x\right )\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^2\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________